<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="按扭1" onclick="f1()">
<input type="button" value="按扭2" onclick="f2('刘德华',22)">
<script>
  //无参无返回值的方法
  function f1(){
    console.log("f1")
  }
  f1();
  //有参无返回值
  function f2(name,age) {
    console.log(name+":"+age)
  }
  f2("蔡徐坤",22);
  //无参有返回值
  function f3() {
    return "蔡徐坤你好"
  }
  let info=f3();
  console.log(info);
  //有参有返回值
  function f4(x,y) {
    return x*y;
  }
  let q=f4(4,4);
  console.log(q)

  //第二种定义方法
  let f5=function (name,age) {
    console.log(name+":"+age)
  }
  f5("吴亦凡",22);
  //第三种定义方法
  let f6=new Function("name","age","console.log(name+':'+age)")
   f6("范丞丞",22)
</script>
</body>
</html>